package com.niiwoo.civet.trade.dto.request.kaola;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 考拉债权转让协议签署结果请求DTO
 *
 * @author liming
 * @date 2017-12-29 20:06
 */
@Getter
@Setter
@ToString
public class KaoLaDebtResultNotifyRequestDTO implements Serializable {

    private static final long serialVersionUID = 8818317824638826543L;
    /**
     * 交易号
     */
    private String transaction_id;

    /**
     * 合同编号
     */
    private String contract_id;

    /**
     * 签章结果代码(3000（签章成功）3001(签章失败) )
     */
    private String result_code;

    /**
     * 签章结果描述
     */
    private String result_desc;

    /**
     * 下载地址
     */
    private String download_url;

    /**
     * 查看地址
     */
    private String viewpdf_url;

    /**
     * 请求时间
     */
    private String timestamp;

    /**
     * 摘要
     */
    private String msg_digest;

    public boolean isSuccess(){
        return KaoLaDebtResultEnum.SUCCESS.getCode().equals(this.result_code);
    }

    @Getter
    @AllArgsConstructor
    public enum KaoLaDebtResultEnum {
        SUCCESS("3000","签章成功"),
        FAIL("3001","签章失败");

        private String code;
        private String description;
    }


}
